export const DataGS = {
    getItem(key, defaultVal) {
        let ret = cc.sys.localStorage.getItem(key);
        let data = defaultVal;
        if (ret) {
            try {
                data = JSON.parse(ret);
            } catch (e) {
                
            }
        }
        return data;
    },

    setItem(key, value) {
        let strValue = JSON.stringify(value);
        cc.sys.localStorage.setItem(key, strValue);
    },

    removeItem(key) {
        cc.sys.localStorage.removeItem(key);
    },
}
